// 创建一个路由器，并暴露出去
// 第一步：引入createRouter
import {createRouter, createWebHistory} from "vue-router";
// 引入一个一个可能要呈现组件
import Layout from "@/views/Layout.vue";
import Login from "@/views/Login.vue";
import UserForgotPassword from "@/views/UserForgotPassword.vue";
import User from "@/views/User.vue";
import Patient from "@/views/Patient.vue";
import Medicine from "@/views/Medicine.vue";
import Auth from "@/views/Auth.vue";
import Department from "@/views/Department.vue";
import Category from "@/views/Category.vue";
import Restocking from "@/views/Restocking.vue";
import Order from "@/views/Order.vue";
import Chart from "@/views/Chart.vue";
import UserInfo from "@/views/UserInfo.vue";
import UserAvatar from "@/views/UserAvatar.vue";
import UserResetPassword from "@/views/UserResetPassword.vue";

//创建路由器
const router = createRouter({
    history: createWebHistory(),
    routes: [
        {path: "/login", component: Login},
        {path: "/userForgotPassword", component: UserForgotPassword},
        {
            path: "/", component: Layout, children: [
                {path: "/user", component: User},
                {path: "/patient", component: Patient},
                {path: "/medicine", component: Medicine},
                {path: "/auth", component: Auth},
                {path: "/department", component: Department},
                {path: "/category", component: Category},
                {path: "/restocking", component: Restocking},
                {path: "/order", component: Order},
                {path: "/echarts", component: Chart},
                {path: "/userInfo", component: UserInfo},
                {path: "/userAvatar", component: UserAvatar},
                {path: "/userResetPassword", component: UserResetPassword}
            ]
        }
    ]
})

// 暴露出去router
export default router